#include "stdafx.h"

#include "LoaderUtil.h"

int HexToInt(const string& n)
{
	string num = n;
	for(auto i = num.begin(); i != num.end(); ++i)
		*i = toupper(*i);
	int e=0;
	int result = 0;
	for(auto iter = num.rbegin(); iter != num.rend(); ++iter, e++)
	{
		if( '0' <= *iter && *iter <= '9' )
			result += (*iter - '0') * pow(16.0, e);
		else
			result += (*iter - 'A' + 10) * pow(16.0, e);
	}
	return result;
}